import org.korifey.ffalg.NumberTheory;


public class Problem10 {
	public static void main(String[] args) {
		System.out.println(solve());
	}

	public static long solve() {
		int[] primes = NumberTheory.erathosphen(2000000);
		long res = 0;
		for (int p: primes) {
			res += p;
		}
		return res;
	}
}
